/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.monVehicule.dao.ajouter;

import fr.monVehicule.entite.Modele;
import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

/**
 *
 * @author David
 */
public class ModeleDAO extends DAO<Modele> {
    
    public ModeleDAO()
    {
        super(Modele.class);
    }
    
    public List<Modele> findModelesByMarque(Integer idMarque){
        List<Modele> list = null;
        Criteria criteria = createCriteria();
        criteria.createAlias("marque", "marque");
        criteria.add(Restrictions.eq("marque.id", idMarque));
        list = criteria.list();
        return list;
    }
}
